---
// Mermaid.astro
const { code } = Astro.props;
let content = await Astro.slots.render('default');
if (!content) {
    content=""
}
console.log(code)
// content=content.replaceAll("<p>", '\n').replaceAll("</p>", '\n').replaceAll("—>","-->");

---
<div class="mermaid" set:html={code}>
</div>
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs">
    mermaid.initialize({ startOnLoad: true });
</script>
